﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Areas.Manage.Models.Authorization.EditModel>" %>

<%@ Import Namespace="Code.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%="Edit".Equals(ViewData["act"] as string,StringComparison.CurrentCultureIgnoreCase)?"编辑角色":"新增角色" %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<fieldset>
    <legend>
        <%="Edit".Equals(ViewData["act"] as string,StringComparison.CurrentCultureIgnoreCase)?"编辑角色":"新增角色" %>
    </legend>
    <%=Html.ActionLink(">>列表", "Role", null ,new { @class = "a_blue" })%>
    <% Html.BeginForm(); %>
    <ul class="editlist">
        <li>
            <label class="label" for="Role_Name">角色名称：</label>
            <span class="spans">
                <%=Html.TextBoxFor(p=>p.Role.Name) %>
                <%=Html.ValidationMessageFor(p=>p.Role.Name) %>
            </span>
        </li>
        <li>
            <label class="label" for="Role_Name">角色状态：</label>
            <span class="spans">
                <%=Html.RadioButtonFor(p => p.Role.State, RoleState.Enable, new { id = "Role_State_Enable" })%>
                <label for="Role_State_Enable">启用</label>
                <%=Html.RadioButtonFor(p => p.Role.State, RoleState.Disable, new { id="Role_State_Disable"})%>
                <label for="Role_State_Disable">禁用</label>
                <%=Html.ValidationMessageFor(p=>p.Role.Name) %>
            </span>
        </li>
        <li></li>
        <% var tp = string.Empty; %>
        <% for (int i = 0; i < Model.Role.Authoritys.Length; i++) %>
        <% { var item = Model.Role.Authoritys[i]; %>
        <% if (tp != item.Remark)%>
        <% { %>
        <%=tp == string.Empty ? "" : "</span></li>"%>
        <li>
            <label class="label"><%=item.Remark%>：</label>
            <span class="spans width620">
                <% tp = item.Remark;%>
                <% } %>
                <span class="span1 width120">
                    <%=Html.CheckBoxFor(p => p.Role.Authoritys[i].State, item.State)%>
                    <%=Html.HiddenFor(p => p.Role.Authoritys[i].ID)%>
                    <%=Html.HiddenFor(p => p.Role.Authoritys[i].Name)%>
                    <%=Html.HiddenFor(p => p.Role.Authoritys[i].Remark)%>
                    <label for='Role_Authoritys_<%=i %>__State'><%=item.Name%></label>
                </span>
                <% } %>
            </span>
        </li>
        <li class="btn">
            <input type="submit" value="保存" onclick="return confirm('确定提交吗？')" />
        </li>
    </ul>
    <%=Html.HiddenFor(p=>p.Role.ID) %>
    <%=Html.SerializableFor(p=>p.Auths) %>
    <% Html.EndForm(); %>
</fieldset>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
<style type="text/css">
    .width620{ width:620px;}
</style>
</asp:Content>
